Crate tokay_macros

source ·
Expand description

Tokay proc-macros

This crate contains the proc-macro implementation for

  • tokay_function!(signature, expression) - Built-in function
  • tokay_method!(signature, expression) - Built-in object method
  • tokay_token!(signature, expression) - Built-in consuming function

Every macro generates a slightly different version of a callable built-in.

All macros require for two parameters:

  • signature is a Tokay-style function signature string, including default values. This can be f, f(), f(a, b), f(a b = void) or similar. Currently, this does only accept for a subset of Tokay atomics: void, null, true, false, and integer values.
  • expression is the Rust expression to be executed. This is the body of the function.

Macros